hook::add message bot:eval 88
set opt(eval) 1
proc bot:eval {from type body} {

	if {[cmd "$body" eval]} {
		set ifadm [ifadmin $from]

		if {$ifadm>4} {
			set tmpaa [string range $body 5 [string length $body]]
			set tmp [string map {"\\\\\\\\\\" "" "]" "]"} $tmpaa]

			#set cmd [split $tmp "|"]
			set cmd "$tmp"
			putlog "c==>$cmd"
			if { $type=="chat"} {
			
				set code [catch { eval  [string map {&amp & &lt < &gt > &quot \" _lfs_ \{ _rfs_ \} _dlr_ \$} $tmp]} state]
				if {$code} {
					pm "$from" "Eval failed:\nReturned code $code\n$state"
					return stop
				} else {
					pm "$from" "eval OK"
				}
				return stop
				#pm "$from" "[uplevel #0 [string map {&amp & &lt < &gt > &quot \" _lfs_ \{ _rfs_ \} _dlr_ \$} $tmp]]"
				#return stop
			} else {
				set code [catch { eval  [string map {&amp & &lt < &gt > &quot \" _lfs_ \{ _rfs_ \} _dlr_ \$} $tmp]} state]
				if {$code} {
					gm "$from" "Returned code $code\n$state"
					return stop
				} else {
					gm "$from" "eval OK"
				}
				//gm "$from" "[uplevel #0 [string map {&amp & &lt < &gt > &quot \" _lfs_ \{ _rfs_ \} _dlr_ \$} $tmp]]"
				return stop
			}
		} else {putlog "NOBODY";return stop}
	}
}